Skip to content

Conversation

longfangsong
Copy link

Fixes #14491

I'm not so sure about the expected behaviour here, I presume that one should document panics and errors on main?

So I remove the is_entrypoint_fn here.

changelog: [missing_panics_doc & missing_panics_doc]: enable checking doc attributes on entrypoint function

@rustbot
Copy link
Collaborator

rustbot commented Mar 30, 2025

r? @dswij

rustbot has assigned @dswij.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 30, 2025
@rustbot
Copy link
Collaborator

rustbot commented Mar 31, 2025

☔ The latest upstream changes (possibly d28d234) made this pull request unmergeable. Please resolve the merge conflicts.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Mar 31, 2025
@@ -0,0 +1,29 @@
//@aux-build:macro_rules.rs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd prefer to have this test together in tests/ui/missing_panics_doc.rs.

if !(is_entrypoint_fn(cx, item.owner_id.to_def_id())
|| item.span.in_external_macro(cx.tcx.sess.source_map()))
{
if !(item.span.in_external_macro(cx.tcx.sess.source_map())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems the extra parentheses () is unnecessary here.

Suggested change
if !(item.span.in_external_macro(cx.tcx.sess.source_map())) {
if !item.span.in_external_macro(cx.tcx.sess.source_map()) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to expect the missing_panics_doc and missing_errors_doc lints on main function
3 participants